<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<%@include file="/WEB-INF/jsp/base/head.jsp"%> 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head> 
<script type="text/javascript" src="<%=request.getContextPath() %>/js/preview.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
$(function(){
	if($('a.preview').length){
		var img = preloadIm();
		imagePreview(img);
	}
})
</script>
<style type="text/css">
*{margin:0;padding:0;}
a,img{border:0;}
ul,li{list-style-type:none;}
/* demo */
.demo{width:600px;margin:40px auto;}
.demo h2{font-size:14px;height:62px;color:#3366cc;}
.demo a{font-size:14px;color:#333;text-decoration:none;}
.demo a img{border:solid 1px #ddd;margin:0 5px;}
/* previewShowWindow */
.previewShowWindow{position:absolute;border:1px solid #dadade;background:#95959d;padding:5px;display:none;color:#fff;text-align:center;z-index:999;}
</style>
<title>餐厅菜品列表</title>
</head>
<body>
	<s:form id="form1" namespace="/dishes" action="dishesAction!getDishes" name="form1" method="post">
	
		<input type="hidden" name="dishesBizBean.rmid" value="${dishesBizBean.rmid}" />
		<input type="hidden" name="dishesBizBean.rmName" value="${dishesBizBean.rmName}" />
		<input type="hidden" name="dishesBizBean.rid" value="${dishesBizBean.rid}" />
		
		<input type="hidden" id="addURL"  value="dishesAction!getDishesAdd.do"/>
		<input type="hidden" id="delURL"  value="dishesAction!dishesDelete.do"/>
		<input type="hidden" id="editURL" value="dishesAction!getDishesEdit.do"/>
		
		<div style="padding-left: 20px;margin-bottom: 20px;"><font style="font-weight: bold;">当前位置：<a href="<%=request.getContextPath() %>/restaurantMenu/restaurantMenuAction!getRestaurantMenus.do?restaurantMenuBizBean.rid=${dishesBizBean.rid}">餐厅菜单</a></font>[<span style="font-weight:bold;color: red;">${dishesBizBean.rmName}</span>] --> 的菜品列表 </div>
			
		<div id="btn-option" style="padding-left: 10px;margin:0px;float: none;">
			<a class="add-btn"  id="add" 		href="javascript:void(0);" title="新增">新增</a>
			<a class="edit-btn" id="edit"       href="javascript:void(0);" title="修改">修改</a>
			<a class="del-btn"  id="delete"     href="javascript:void(0);" title="删除">删除</a>
		</div>
		
		<div id="search-btn-wapper" style="padding-left: 20px;margin-top: 10px">
			<label for="">菜品名称：</label>
			<input type="text" class="inputText" name="dishesBizBean.title" value="${dishesBizBean.title}" />
			<s:submit cssClass="btn"  method="getDishes" id="btnEnter" value="查询" ></s:submit>
		</div>
       
        <div id="item-list">
			<table>
			   <thead>
			     <tr>
					<th>选择<input type="checkbox" id="selectAll" /></th>
					<th>菜品编号</th>
					<th>菜品名称</th>
					<th>价格</th>
					<th>图片</th>
				 </tr>
			   </thead>
			   <tbody>
					<s:iterator value="dishesBizBeans" status="sta">
					<tr>
						<td><input type="checkbox" class="classCheckbox" name="dishesBizBeans[${sta.index}].id" value="${id}" /></td>
						<td>${dno}</td>
						<td>${title}</td>
						<td>${price}</td>
						<td><a class="preview" href="#" path="<%=request.getContextPath() %>/restaurant/${imagePath}" ><img alt="" src="<%=request.getContextPath() %>/restaurant/${imagePath}" width="30px" height="20px"></a></td>
					</tr>
					</s:iterator>
					<s:if test="dishesBizBeans == null || dishesBizBeans.size == 0">
					    <tr>
					       <td colspan="5"><span class="spanRB">数据暂无!</span></td>
					    </tr>
					</s:if>
				</tbody>
			</table>
		</div>
    </s:form>
	<d:page namespace="/dishes" action="dishesAction!getDishes">
		<d:param name="dishesBizBean.rmid" value="${dishesBizBean.rmid}"></d:param>
		<d:param name="dishesBizBean.rmName" value="${dishesBizBean.rmName}"></d:param>
		<d:param name="dishesBizBean.rid" value="${dishesBizBean.rid}" ></d:param>
	</d:page>
</body>
</html>